﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace scomA3proj
{
    /// <summary>
    /// The final result of the FindKeyword web service.
    /// The class contains ResultStatus, keywords and a possible DateTime the document was created.
    /// </summary>
    [DataContractAttribute]
    public class DocumentResult
    {
        /// <summary>
        /// enum of the possible result statuses for a given document.
        /// </summary>
        /// 
        [DataContract]
        public enum ResultStatus { [EnumMember]Ok = 0, [EnumMember] UrlNotFound = 1, [EnumMember] OtherError = 2 };
        /// <summary>
        /// The result for the given document.
        /// </summary>
        /// 
        [DataMember]
        public ResultStatus Result { get; private set; }
        /// <summary>
        /// Url of the docuemnt.
        /// </summary>
        [DataMember]
        public string Url { get; private set; }
        /// <summary>
        /// Possible date of the document.
        /// </summary>
        [DataMember]
        public DateTime Date { get; private set; }
        /// <summary>
        /// Keywords of the document.
        /// </summary>
        [DataMember]
        public List<string> Keywords { get; private set; }


        public DocumentResult(string url, DateTime dt, List<string> keywords, ResultStatus result)
        {
            this.Url = url;
            this.Date = dt;
            this.Keywords = keywords;
            this.Result = result;
        }
    }
}
